/*
 * 	Copyright © OpenAtom Foundation.
 * 	Licensed under the Apache License, Version 2.0 (the "License");
 * 	you may not use this file except in compliance with the License.
 * 	You may obtain a copy of the License at
 * 	     http://www.apache.org/licenses/LICENSE-2.0
 * 	Unless required by applicable law or agreed to in writing, software
 * 	distributed under the License is distributed on an "AS IS" BASIS,
 * 	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
 * 	See the License for the specific language governing permissions and
 * 	limitations under the License.
 *
 */

package com.inspur.edp.sgf.api.service;

import com.inspur.edp.sgf.api.Constants;
import com.inspur.edp.sgf.api.entity.EApiSummaryInfo;
import io.iec.edp.caf.rpc.api.annotation.GspServiceBundle;
import io.iec.edp.caf.rpc.api.annotation.RpcServiceMethod;

import java.util.HashMap;
import java.util.List;

/**
 * EApi各个SU的通用服务，用于提取指定SU下手工开发的外部服务
 */
@GspServiceBundle
public interface EApiSUService {

    /**
     * 根据SU获取EApi的概要信息列表
     *
     * @param serviceUnitCode SU编号
     * @return EAPI的概要信息集合
     */
    @RpcServiceMethod(serviceId = Constants.LISTSUMMARIES_SERVICE_ID)
    List<EApiSummaryInfo> listEApiSummaries(String serviceUnitCode);

    /**
     * 根据SU和EApi的概要信息获取EApi的完整Content
     *
     * @param serviceUnitCode  SU编号
     * @param eApiSummaryInfos EAPI的概要信息集合
     * @return 根据SU和EApi的概要信息获取到的EApi完整Content
     */
    @RpcServiceMethod(serviceId = Constants.LISTCONTENTS_SERVICE_ID)
    HashMap<String, String> listEApiContents(String serviceUnitCode, List<EApiSummaryInfo> eApiSummaryInfos);

    /**
     * 获取EAPI元数据引用的VO的Oas3.0 Schema
     *
     * @param voId VO元数据的ID
     * @return Oas3.0 Schema的序列化结果
     */
    @RpcServiceMethod(serviceId = Constants.EAPI_REF_VO_SCHEMA_SERVICE_ID)
    String getEApiRefVOSchemas(String voId);

    /**
     * 获取手工开发的EApi完整信息
     *
     * @param eApiSummaryInfo
     * @return
     */
    @RpcServiceMethod(serviceId = Constants.CONTENT_SERVICE_ID)
    String getEApiContent(EApiSummaryInfo eApiSummaryInfo);

}
